home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / wasm223.zip / TIMER < prev    next >
Text File  |  1993-05-04  |  944b  |  34 lines

  1. //
  2. // SESSION Timer Routines, By Eric Tauck
  3. //
  4.  
  5. Timer_End JUMP
  6.  
  7. : _ExpireTime { 0 }             // used by timer routines
  8.  
  9. // ----------------------------------
  10. // Set the time to wait for an event.
  11. // ----------------------------------
  12.  
  13. : TimerReset                    // (ticks - )
  14.   _ExpireTime ! RESET ;         // store to global variable and reset timer
  15.  
  16. // --------------------------------------
  17. // Check if the time to wait has expired.
  18. // --------------------------------------
  19.  
  20. : TimerExpired                  // ( - 0 | -1)
  21.   _ExpireTime @ TICKS < ;       // check if ticks are greater
  22.  
  23. // --------------------------
  24. // Pause for a tick duration.
  25. // --------------------------
  26.  
  27. : Pause                         // (ticks - )
  28.   TimerReset CALL               // reset timer
  29.   : Pause1
  30.   TimerExpired CALL             // check if expired
  31.   NOT Pause1 ?JUMP ;            // loop back if not
  32.  
  33. : Timer_End
  34.